/**
 * 
 */
package ec.app.deferEvalCoevolve1;

import ec.Individual;
import ec.util.SortComparatorL;

class EliteComparatorVar2 implements SortComparatorL {
	Individual[] inds;
	
	static int trialCount = 0;

	/**
	 * @return the trialCount
	 */
	public static int getTrialCount() {
		return trialCount;
	}

	/**
	 * @param trialCount the trialCount to set
	 */
	public static void setTrialCount(int trialCount) {
		trialCount = trialCount;
	}
	
	public static void resetTrialCount() {
		trialCount = 0;
	}

	public EliteComparatorVar2(Individual[] inds) {
		super();
		this.inds = inds;
	}

	public boolean lt(long a, long b) {
		boolean retVal = false;
		trialCount += 1;
		if( inds[(int) a].fitness.betterThan(inds[(int) b].fitness) )
			retVal = true;
		else
			retVal = false;
		return retVal;
	}

	public boolean gt(long a, long b) {
		boolean retVal = false;
		trialCount += 1;
		if( inds[(int) b].fitness.betterThan(inds[(int) a].fitness) )
			retVal = true;
		else
			retVal = false;
		return retVal;
	}
}
